package com.online.olsrootserver.service.impl;

import com.online.olsrootserver.service.SessionService;
import com.online.olsrootserver.slave0.Session0Mapper;
import com.online.olsrootserver.slave1.Session1Mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by littleheng on 2018/4/27
 */
@Service
public class SessionServiceImpl implements SessionService {

    @Autowired
    private Session0Mapper session0Mapper;

    @Autowired
    private Session1Mapper session1Mapper;

    @Override
    public List<String> getSessionIdList(String companyId, String customerId) {
        if (Integer.parseInt(companyId) % 2 == 0) {
            return this.session0Mapper.getSessionIdList(customerId);
        } else {
            return this.session1Mapper.getSessionIdList(customerId);
        }
    }


}